<template>
    <h1>pinia</h1>
    {{ counterStore.count }}
    <button @click="add">加1</button>
</template>
<script setup>
    // pinia 状态管理库，全局状态管理
    import { useCounterStore } from '@/stores/counter';
    const counterStore = useCounterStore()
    const add = () => {
        counterStore.increment()
    }
</script>